<h1>Settings</h1>
	<p>
	<form id="settings-form" method="POST" action="">
	<?php
			$opts = read_options('', 'OBJECT'); 
	?>
	<fieldset style="border: 1px solid #dedede;">
	<legend>General</legend>
	<table class="greentable">
			<tr id="form-item_company_name">
					<td width="200">Company name</td>
					<td><input style="width:175px" type="text" id="company_name" name="company_name" value="<?=$opts->company_name?>" /></td>
			</tr>
			<tr id="form-item_admin_email">
					<td width="200">Admin E-mail</td>
					<td><input style="width:175px" type="text" id="admin_email" name="admin_email" value="<?=$opts->admin_email?>" /></td>
			</tr>
			<tr id="form-item_payment_notice_email">
					<td width="200">Payment notice E-mail</td>
					<td><input style="width:175px" type="text" id="payment_notice_email" name="payment_notice_email" value="<?=$opts->payment_notice_email?>" /></td>
			</tr>
			<tr id="form-item_logo">
					<td width="200">Logo</td>
					<td>
						<iframe id="logo-control" height="50px" frameborder="0" src="<?=$base_url?>admin/upload_logo/" /></iframe> 
						<!--<input type="file" id="logo" name="logo" />-->
						<?=$opts->logo&&is_file('./images/'.$opts->logo)?'<div><img id="logo-canvas" src="'.$base_url.'images/'.$opts->logo.'" width="'.$opts->logo_width.'" height="'.$opts->logo_height.'" /></div>':''?>
					</td>
			</tr>		
			<tr id="form-item_logo_size">
					<td width="200">Logo size</td>
					<td>Width: <input style="width:50px" type="text" id="logo_width" name="logo_width" value="<?=$opts->logo_width?>" />&nbsp;px&nbsp;&nbsp;Height: <input style="width:50px" type="text" id="logo_height" name="logo_height" value="<?=$opts->logo_height?>" />&nbsp;px</td>
			</tr>	
	</table>
	</fieldset>
	
	<style type="text/css">
			@font-face {
				font-family: 'Swis721CnBTRoman';
				src: url('/css/fonts/swissc-webfont.eot'); /* IE9 Compat Modes */
				src: url('/css/fonts/swissc-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
					 url('/css/fonts/swissc-webfont.woff') format('woff'), /* Modern Browsers */
					 url('/css/fonts/swissc-webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
					 url('/css/fonts/swissc-webfont.svg#Swis721CnBTRoman') format('svg'); /* Legacy iOS */
			}
			@font-face {
				font-family: 'Swis721CnBTBold';
				src: url('/css/fonts/swisscb-webfont.eot'); /* IE9 Compat Modes */
				src: url('/css/fonts/swisscb-webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
					 url('/css/fonts/swisscb-webfont.woff') format('woff'), /* Modern Browsers */
					 url('/css/fonts/swisscb-webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
					 url('/css/fonts/swisscb-webfont.svg#Swis721CnBTBold') format('svg'); /* Legacy iOS */
			}
	</style>
	
	<fieldset style="border: 1px solid #dedede;">
	<legend>Custom theme</legend>
	<table class="greentable">		
			<tr id="form-item_link_color">
					<td width="200">Links color</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="link_color" name="link_color" class="color-picker" autocomplete="on" value="<?=$opts->link_color?>" />
					</td>
			</tr>
			<tr id="form-item_color_menu_border">
					<td width="200">Menu border</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_menu_border" name="color_menu_border" value="<?=$opts->color_menu_border?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>
			<tr id="form-item_color_menu_item_top_border">
					<td width="200">Menu item top border</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_menu_item_top_border" name="color_menu_item_top_border" value="<?=$opts->color_menu_item_top_border?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>
			<tr id="form-item_color_menu_item_bottom_border">
					<td width="200">Menu item bottom border</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_menu_item_bottom_border" name="color_menu_item_bottom_border" value="<?=$opts->color_menu_item_bottom_border?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>
			<tr id="form-item_color_menu_item_background">
					<td width="200">Menu item background</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_menu_item_background" name="color_menu_item_background" value="<?=$opts->color_menu_item_background?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>
			<tr id="form-item_color_menu_item_link">
					<td width="200">Menu item link</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_menu_item_link" name="color_menu_item_link" value="<?=$opts->color_menu_item_link?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>
			<tr id="form-item_color_reg_heading">
					<td width="200">Registration heading</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_reg_heading" name="color_reg_heading" value="<?=$opts->color_reg_heading?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr> 
			<tr id="form-item_color_reg_intro">
					<td width="200">Registration intro</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_reg_intro" name="color_reg_intro" value="<?=$opts->color_reg_intro?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr> 
			<tr id="form-item_color_reg_perso_legend">
					<td width="200">Registration &quot;personal data&quot; legend</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_reg_perso_legend" name="color_reg_intro" value="<?=$opts->color_reg_perso_legend?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr> 
			<tr id="form-item_color_reg_trading_exp">
					<td width="200">Registration &quot;trading experience&quot; legend</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_reg_trading_exp" name="color_reg_trading_exp" value="<?=$opts->color_reg_trading_exp?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr> 
			<tr id="form-item_color_reg_title_num_bg_color">
					<td width="200">Registration title number bg</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_reg_title_num_bg_color" name="color_reg_title_num_bg_color" value="<?=$opts->color_reg_title_num_bg_color?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>  
			<tr id="form-item_color_reg_title_bottom_border_color">
					<td width="200">Registration title bottom border</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_reg_title_bottom_border_color" name="color_reg_title_bottom_border_color" value="<?=$opts->color_reg_title_bottom_border_color?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>  
			<tr id="form-item_color_reg_title_caption_bg_color">
					<td width="200">Registration title caption bg</td>
					<td>
						<input style="width:50px;vertical-align:middle;" type="text" id="color_reg_title_caption_bg_color" name="color_reg_title_caption_bg_color" value="<?=$opts->color_reg_title_caption_bg_color?>" class="color-picker" autocomplete="on"  />
					</td>
			</tr>  
			<tr id="form-item_color_reg_button">
					<td width="200">Registration button</td>
					<td>
							Border: <input style="width:50px;vertical-align:middle;" type="text" id="color_reg_button_border" name="color_reg_button_border" value="<?=$opts->color_reg_button_border?>" class="color-picker" autocomplete="on"  /><br />
							Background: <input style="width:50px;vertical-align:middle;" type="text" id="color_reg_button_bg" name="color_reg_button_bg" value="<?=$opts->color_reg_button_bg?>" class="color-picker" autocomplete="on"  /><br />
							From color (gradient): <input style="width:50px;vertical-align:middle;" type="text" id="color_reg_button_gradient_from" name="color_reg_button_gradient_from" value="<?=$opts->color_reg_button_gradient_from?>" class="color-picker" autocomplete="on"  /><br />
							To color(gradient): <input style="width:50px;vertical-align:middle;" type="text" id="color_reg_button_gradient_to" name="color_reg_button_gradient_to" value="<?=$opts->color_reg_button_gradient_to?>" class="color-picker" autocomplete="on"  /><br />
					</td>
			</tr> 
			<tr id="form-item_font_family">
					<td width="200">Standard Font family</td>
					<td>
							<div class="curFont" style="font-weight:bold;">Current: <span style="font-size:1em;"><?=@$opts->font_family?></span></div>
							<div id="font_select-1">
								<input type="hidden" name="cur_font_family" />
								<select name="font_1" style="font-size: 1.2em;">
									<optgroup label="Fonts">
										<option style="" value="">-- choose --</option>
										<option style="font-family: Arial" value="Arial" selected>Arial</option>
										<option style="font-family: Arial Black" value="Arial Black">Arial Black</option>
										<option style="font-family: Arial Narrow" value="Arial Narrow">Arial Narrow</option>
										<option style="font-family: Book Antiqua" value="Book Antiqua">Book Antiqua</option>
										<option style="font-family: Century Gothic" value="Century Gothic">Century Gothic</option>
										<option style="font-family: Charcoal" value="Charcoal">Charcoal</option>
										<option style="font-family: Comic Sans MS" value="Comic Sans MS">Comic Sans MS</option>
										<option style="font-family: Courier" value="Courier">Courier</option>
										<option style="font-family: Courier New" value="Courier New">Courier New</option>
										<option style="font-family: DejaVu Sans" value="DejaVu Sans">DejaVu Sans</option>
										<option style="font-family: Gadget" value="Gadget">Gadget</option>
										<option style="font-family: Geneva" value="Geneva">Geneva</option>
										<option style="font-family: Georgia" value="Georgia">Georgia</option>
										<option style="font-family: Gill Sans" value="Gill Sans">Gill Sans</option>
										<option style="font-family: Gill Sans MT" value="Gill Sans MT">Gill Sans MT</option>
										<option style="font-family: Helvetica" value="Helvetica">Helvetica</option>
										<option style="font-family: Impact" value="Impact">Impact</option>
										<option style="font-family: Lucida Console" value="Lucida Console">Lucida Console</option>
										<option style="font-family: Lucida Grande" value="Lucida Grande">Lucida Grande</option>
										<option style="font-family: Lucida Sans Unicode" value="Lucida Sans Unicode">Lucida Sans Unicode</option>
										<option style="font-family: Monaco" value="Monaco">Monaco</option>
										<option style="font-family: Palatino" value="Palatino">Palatino</option>
										<option style="font-family: Palatino Linotype" value="Palatino Linotype">Palatino Linotype</option>
										<option style="font-family: Swis721CnBTRoman" value="Swis721CnBTRoman">Swis721 Cn BT Roman</option>
										<option style="font-family: Swis721CnBTBold" value="Swis721CnBTBold">Swis721 Cn BT Bold</option>
										<option style="font-family: Tahoma" value="Tahoma">Tahoma</option>
										<option style="font-family: Times" value="Times">Times</option>
										<option style="font-family: Times New Roman" value="Times New Roman">Times New Roman</option>
										<option style="font-family: Trebuchet MS" value="Trebuchet MS">Trebuchet MS</option>
										<option style="font-family: Verdana" value="Verdana">Verdana</option>
									</optgroup>
									<optgroup label="Generic">
										<option style="font-family: cursive" value="cursive">cursive</option>
										<option style="font-family: monospace" value="monospace">monospace</option>
										<option style="font-family: serif" value="serif">serif</option>
										<option style="font-family: sans-serif" value="sans-serif">sans-serif</option>
									</optgroup>
								</select> (<a class="afdd" href="javascript:void(0);" onclick="add_font_drop_down('1');">add</a>)
							</div>
							
							<script type="text/javascript">
									var _fdc = 1;
									var _cfl = '';
									jQuery(document).ready(function(){
											<?php
													if(@$opts->font_family)
													{
															$items = preg_split('#\s*,\s*#is', @$opts->font_family);
															if(count($items)>0)
															{
																	$font_1 = array_shift($items);
																	?>
																	jQuery('select[name=font_1]').val('<?=$font_1?>');
																	<?php
																	$i = 1;
																	foreach($items as $font){
																			$i++;
																			?>
																			add_font_drop_down(<?=($i-1)?>);
																			jQuery('select[name=font_<?=$i?>]').val('<?=$font?>');
																			<?php
																	}
																	echo 'update_fonts_list();';
															}
													}
											?>
									});
									
									jQuery('tr#form-item_font_family select').bind('change', function(){
											update_fonts_list();
									});
									
									function add_font_drop_down(cur) {
											_fdc++;
											var selector_data 	= jQuery('div#font_select-1').html();
												selector_data 	= selector_data.replace(/name="font_1"/gi,'name="font_'+_fdc+'"');
												selector_data 	= selector_data.replace(/add_font_drop_down\('1'\)/gi,"add_font_drop_down('"+_fdc+"')");
											try {
												var _so = jQuery('<div id="font_select-'+_fdc+'">'+selector_data+'</div>');
												_so.find('a.afdd').after(' | <a class="rfdd" href="javascript:void(0);" onclick="remove_font_drop_down(\''+_fdc+'\');">remove</a>');
												selector_data = '<div id="font_select-'+_fdc+'">'+_so.html()+'</div>';
												jQuery('#font_select-'+cur).after(selector_data);
											} catch(err){
												alert(err.message);
											}
											jQuery('tr#form-item_font_family select').unbind('change');
											jQuery('tr#form-item_font_family select').bind('change', function(){ update_fonts_list(); });
											update_fonts_list();
									}
									
									function remove_font_drop_down(sid) {
											jQuery('div#font_select-'+sid).remove();
											jQuery('tr#form-item_font_family select').unbind('change');
											jQuery('tr#form-item_font_family select').bind('change', function(){ update_fonts_list(); });
											update_fonts_list();
									}
									
									function update_fonts_list(){
											_cfl = '';
											try {
												jQuery('tr#form-item_font_family td:eq(1) div select').each(function(index){
														_cfl = _cfl + (_cfl ? ', ' : '') + jQuery(this).val();
												});
												jQuery('input[name=cur_font_family]').val(_cfl);
												jQuery('div.curFont span').html(_cfl);
												jQuery('div.curFont span').css('font-family', _cfl);
											} catch(err){
												alert(err.message);
											}
									}
									
							</script>
					</td>
			</tr>  
			<tr id="form-item_std_font_size">
					<td width="200">Standard font size</td>
					<td>
							<input style="width:50px;vertical-align:middle;" type="text" id="std_font_size" name="std_font_size" value="<?=@$opts->std_font_size?$opts->std_font_size:'16'?>" />
							<select name="std_font_unit">
									<option value="%"<?=@$opts->std_font_unit=='%'?' selected':''?>>%</option>
									<option value="in"<?=@$opts->std_font_unit=='in'?' selected':''?>>inch</option>
									<option value="mm"<?=@$opts->std_font_unit=='mm'?' selected':''?>>mm</option>
									<option value="em"<?=@$opts->std_font_unit=='em'?' selected':''?>>em</option>
									<option value="ex"<?=@$opts->std_font_unit=='ex'?' selected':''?>>ex</option>
									<option value="pt"<?=@$opts->std_font_unit=='pt'?' selected':''?>>pt</option>
									<option value="pc"<?=@$opts->std_font_unit=='pc'?' selected':''?>>pc</option>
									<option value="px"<?=(@$opts->std_font_unit=='px' OR !@$opts->std_font_unit)?' selected':''?>>px</option>
							</select>
					</td>
			</tr> 
			<tr id="form-item_hd_font_family">
					<td width="200">Heading Font family</td>
					<td>
							<div class="curHdFont" style="font-weight:bold;">Current: <span style="font-size:1em;"><?=@$opts->hd_font_family?></span></div>
							<div id="hd_font_select-1">
								<input type="hidden" name="cur_font_family" />
								<input type="hidden" name="cur_hd_font_family" />
								<select name="hd_font_1" style="font-size: 1.2em;">
									<optgroup label="Fonts">
										<option style="" value="">-- choose --</option>
										<option style="font-family: Arial" value="Arial" selected>Arial</option>
										<option style="font-family: Arial Black" value="Arial Black">Arial Black</option>
										<option style="font-family: Arial Narrow" value="Arial Narrow">Arial Narrow</option>
										<option style="font-family: Book Antiqua" value="Book Antiqua">Book Antiqua</option>
										<option style="font-family: Century Gothic" value="Century Gothic">Century Gothic</option>
										<option style="font-family: Charcoal" value="Charcoal">Charcoal</option>
										<option style="font-family: Comic Sans MS" value="Comic Sans MS">Comic Sans MS</option>
										<option style="font-family: Courier" value="Courier">Courier</option>
										<option style="font-family: Courier New" value="Courier New">Courier New</option>
										<option style="font-family: DejaVu Sans" value="DejaVu Sans">DejaVu Sans</option>
										<option style="font-family: Gadget" value="Gadget">Gadget</option>
										<option style="font-family: Geneva" value="Geneva">Geneva</option>
										<option style="font-family: Georgia" value="Georgia">Georgia</option>
										<option style="font-family: Gill Sans" value="Gill Sans">Gill Sans</option>
										<option style="font-family: Gill Sans MT" value="Gill Sans MT">Gill Sans MT</option>
										<option style="font-family: Helvetica" value="Helvetica">Helvetica</option>
										<option style="font-family: Impact" value="Impact">Impact</option>
										<option style="font-family: Lucida Console" value="Lucida Console">Lucida Console</option>
										<option style="font-family: Lucida Grande" value="Lucida Grande">Lucida Grande</option>
										<option style="font-family: Lucida Sans Unicode" value="Lucida Sans Unicode">Lucida Sans Unicode</option>
										<option style="font-family: Monaco" value="Monaco">Monaco</option>
										<option style="font-family: Palatino" value="Palatino">Palatino</option>
										<option style="font-family: Palatino Linotype" value="Palatino Linotype">Palatino Linotype</option>
										<option style="font-family: Swis721CnBTRoman" value="Swis721CnBTRoman">Swis721 Cn BT Roman</option>
										<option style="font-family: Swis721CnBTBold" value="Swis721CnBTBold">Swis721 Cn BT Bold</option>
										<option style="font-family: Tahoma" value="Tahoma">Tahoma</option>
										<option style="font-family: Times" value="Times">Times</option>
										<option style="font-family: Times New Roman" value="Times New Roman">Times New Roman</option>
										<option style="font-family: Trebuchet MS" value="Trebuchet MS">Trebuchet MS</option>
										<option style="font-family: Verdana" value="Verdana">Verdana</option>
									</optgroup>
									<optgroup label="Generic">
										<option style="font-family: cursive" value="cursive">cursive</option>
										<option style="font-family: monospace" value="monospace">monospace</option>
										<option style="font-family: serif" value="serif">serif</option>
										<option style="font-family: sans-serif" value="sans-serif">sans-serif</option>
									</optgroup>
								</select> (<a class="afdd" href="javascript:void(0);" onclick="add_font_drop_down2('1');">add</a>)
							</div>
							
							<script type="text/javascript">
									var _fdc2 = 1;
									var _cfl2 = '';
									jQuery(document).ready(function(){
											<?php
													if(@$opts->hd_font_family)
													{
															$items = preg_split('#\s*,\s*#is', @$opts->hd_font_family);
															if(count($items)>0)
															{
																	$font_1 = array_shift($items);
																	?>
																	jQuery('select[name=hd_font_1]').val('<?=$font_1?>');
																	<?php
																	$i = 1;
																	foreach($items as $font){
																			$i++;
																			?>
																			add_font_drop_down2(<?=($i-1)?>);
																			jQuery('select[name=hd_font_<?=$i?>]').val('<?=$font?>');
																			<?php
																	}
																	echo 'update_fonts_list2();';
															}
													}
											?>
									});
									
									jQuery('tr#form-item_hd_font_family select').bind('change', function(){
											update_fonts_list2();
									});
									
									function add_font_drop_down2(cur) {
											_fdc2++;
											var selector_data 	= jQuery('div#hd_font_select-1').html();
												selector_data 	= selector_data.replace(/name="hd_font_1"/gi,'name="hd_font_'+_fdc2+'"');
												selector_data 	= selector_data.replace(/add_font_drop_down2\('1'\)/gi,"add_font_drop_down2('"+_fdc2+"')");
											try {
												var _so = jQuery('<div id="hd_font_select-'+_fdc2+'">'+selector_data+'</div>');
												_so.find('a.afdd').after(' | <a class="rfdd" href="javascript:void(0);" onclick="remove_font_drop_down2(\''+_fdc2+'\');">remove</a>');
												selector_data = '<div id="hd_font_select-'+_fdc2+'">'+_so.html()+'</div>';
												jQuery('#hd_font_select-'+cur).after(selector_data);
											} catch(err){
												alert(err.message);
											}
											jQuery('tr#form-item_hd_font_family select').unbind('change');
											jQuery('tr#form-item_hd_font_family select').bind('change', function(){ update_fonts_list2(); });
											update_fonts_list();
									}
									
									function remove_font_drop_down2(sid) {
											jQuery('div#hd_font_select-'+sid).remove();
											jQuery('tr#form-item_hd_font_family select').unbind('change');
											jQuery('tr#form-item_hd_font_family select').bind('change', function(){ update_fonts_list2(); });
											update_fonts_list2();
									}
									
									function update_fonts_list2(){
											_cfl2 = '';
											try {
												jQuery('tr#form-item_hd_font_family td:eq(1) div select').each(function(index){
														_cfl2 = _cfl2 + (_cfl2 ? ', ' : '') + jQuery(this).val();
												});
												jQuery('input[name=cur_hd_font_family]').val(_cfl2);
												jQuery('div.curHdFont span').html(_cfl2);
												jQuery('div.curHdFont span').css('font-family', _cfl2);
											} catch(err){
												alert(err.message);
											}
									}
									
							</script>
					</td>
			</tr> 
			<tr id="form-item_hd_font_size">
					<td width="200">Heading font size</td>
					<td>
							<input style="width:50px;vertical-align:middle;" type="text" id="hd_font_size" name="hd_font_size" value="<?=@$opts->hd_font_size?$opts->hd_font_size:'16'?>" />
							<select name="std_font_unit">
									<option value="%"<?=@$opts->std_font_unit=='%'?' selected':''?>>%</option>
									<option value="in"<?=@$opts->std_font_unit=='in'?' selected':''?>>inch</option>
									<option value="mm"<?=@$opts->std_font_unit=='mm'?' selected':''?>>mm</option>
									<option value="em"<?=@$opts->std_font_unit=='em'?' selected':''?>>em</option>
									<option value="ex"<?=@$opts->std_font_unit=='ex'?' selected':''?>>ex</option>
									<option value="pt"<?=@$opts->std_font_unit=='pt'?' selected':''?>>pt</option>
									<option value="pc"<?=@$opts->std_font_unit=='pc'?' selected':''?>>pc</option>
									<option value="px"<?=(@$opts->std_font_unit=='px' OR !@$opts->std_font_unit)?' selected':''?>>px</option>
							</select>
					</td>
			</tr> 
	</table>
	</fieldset>
	
	<fieldset style="border: 1px solid #dedede;">
	<legend>MT4</legend>
	<table class="greentable">
			<tr id="form-item_mt4_host">
					<td width="200">Host</td>
					<td><input style="width:175px" type="text" id="mt4_host" name="mt4_host" value="<?=$opts->mt4_host?>" /></td>
			</tr>
			<tr id="form-item_mt4_port">
					<td width="200">Port</td>
					<td><input style="width:50px" type="text" id="mt4_port" name="mt4_port" value="<?=$opts->mt4_port?>" /></td>
			</tr>
			<tr id="form-item_default_agent">
					<td width="200">Default agent</td>
					<td><input style="width:175px" type="text" id="default_agent" name="default_agent" value="<?=$opts->default_agent?>" /></td>
			</tr>
			<tr id="form-item_default_group">
					<td width="200">Live group</td>
					<td><input style="width:175px" type="text" id="default_group" name="default_group" value="<?=$opts->default_group?>" /></td>
			</tr>
			<tr id="form-item_default_leverage">
					<td width="200">Live leverage</td>
					<td><input style="width:175px" type="text" id="default_leverage" name="default_leverage" value="<?=$opts->default_leverage?>" /></td>
			</tr>
			<tr id="form-item_default_demo_group">
					<td width="200">Demo group</td>
					<td><input style="width:175px" type="text" id="default_demo_group" name="default_demo_group" value="<?=$opts->default_demo_group?>" /></td>
			</tr>
			<tr id="form-item_demo_leverage">
					<td width="200">Demo leverage</td>
					<td><input style="width:175px" type="text" id="demo_leverage" name="demo_leverage" value="<?=$opts->demo_leverage?>" /></td>
			</tr>
			<tr id="form-item_partner_group">
					<td width="200">Partner group</td>
					<td><input style="width:175px" type="text" id="partner_group" name="partner_group" value="<?=$opts->partner_group?>" /></td>
			</tr>
			<tr id="form-item_partner_leverage">
					<td width="200">Partner leverage</td>
					<td><input style="width:175px" type="text" id="partner_leverage" name="partner_leverage" value="<?=$opts->partner_leverage?>" /></td>
			</tr>
			<tr id="form-item_aim_group">
					<td width="200">AIM group</td>
					<td><input style="width:175px" type="text" id="aim_group" name="aim_group" value="<?=$opts->aim_group?>" /></td>
			</tr>
			<tr id="form-item_aim_leverage">
					<td width="200">AIM leverage</td>
					<td><input style="width:175px" type="text" id="aim_leverage" name="aim_leverage" value="<?=$opts->aim_leverage?>" /></td>
			</tr>
			<tr id="form-item_aim_leverage">
					<td width="200">AIM signup notifications</td>
					<td>
							<div>
								<input type="checkbox" id="aim_alert_client" name="aim_alert_client" value="yes" <?=$opts->aim_alert_client=='yes'?' checked':''?>/>  Send Email to Client 
							</div>
							<div>
								<input type="checkbox" id="aim_alert_admin" name="aim_alert_admin" value="yes" <?=$opts->aim_alert_admin=='yes'?' checked':''?>/> Email Notify Admin 
							</div>
					</td>
			</tr>
	</table>
	</fieldset>
	
	<fieldset style="border: 1px solid #dedede;">
	<legend>SMTP</legend>
	<table class="greentable">						
			<tr id="form-item_mt4_host">
					<td width="200">Host</td>
					<td>
						<input style="width:175px" type="text" id="smtp_host" name="smtp_host" value="<?=$opts->smtp_host?>" />
						<input type="checkbox" id="smtp_ssl" name="smtp_ssl" value="yes"<?=$opts->smtp_ssl=='yes'?' checked':''?> /> SSL
					</td>
			</tr>
			<tr id="form-item_smtp_port">
					<td width="200">Port</td>
					<td><input style="width:50px" type="text" id="smtp_port" name="smtp_port" value="<?=$opts->smtp_port?>" /></td>
			</tr>
			<tr id="form-item_mt4_host">
					<td width="200">Username</td>
					<td><input style="width:175px" type="text" id="smtp_user" name="smtp_user" value="<?=$opts->smtp_user?>" /></td>
			</tr>
			<tr id="form-item_smtp_pass">
					<td width="200">Password</td>
					<td><input style="width:175px" type="password" id="smtp_pass" name="smtp_pass" value="<?=$opts->smtp_pass?>" /></td>
			</tr>
	</table>
	</fieldset>
	
	<fieldset style="border: 1px solid #dedede;">
	<legend>Affiliate</legend>
	<table class="greentable">						
			<tr id="form-item_mt4_host">
					<td width="200">Enable affiliate features only for <abbr title="Partners">*-IB</abbr></td>
					<td>
							<input type="radio" id="aff_ib_only-yes" name="aff_ib_only" value="yes"<?=$opts->aff_ib_only=='yes'?' checked':''?> /> Yes
							<input type="radio" id="aff_ib_only-no" name="aff_ib_only" value="no"<?=$opts->aff_ib_only!='yes'?' checked':''?> /> No
					</td>
			</tr>
	</table>
	</fieldset>
	
	<fieldset style="border: 1px solid #dedede;">
	<legend>Logging</legend>
	<table class="greentable">						
			<tr id="form-item_mt4_host">
					<td width="200">Enable logging</td>
					<td>
							<input type="radio" id="logging_status-enabled" name="logging_status" value="enabled"<?=$opts->logging_status=='enabled'?' checked':''?> /> Enabled
							<input type="radio" id="logging_status-disabled" name="logging_status" value="disabled"<?=$opts->logging_status=='disabled'?' checked':''?> /> Disabled
					</td>
			</tr>
	</table>
	</fieldset>
	
	
			<div style="text-align:center;">
				<table cellspacing="0" cellpadding="4">
				<tr>
						<td>
							<span id="edit-stat" style="color:orange;font-weight:bold;display:none;"></span>
							<input type="submit" id="bt-save" value="Save changes" class="submit" />
						</td>
				</tr>
				</table>
			</div>
	</form>
	</p>
	<div id="dialog"></div>
	<script src="<?php echo $base_url; ?>js/validation.js"></script>
		<script src="<?php echo $base_url; ?>js/admin_mgt.js"></script>
		<script language="javascript">
				jQuery(document).ready(function() {
						jQuery('#settings-form').bind('submit', function(event){
								return false;
						});
						jQuery('#bt-save').click(function(event){
								GolderMarkets.AdminMgt.SaveSettings();
						});
						jQuery('#edit-form').submit(function(){
								return GolderMarkets.AdminMgt.SaveSettings();
						});
				});
	</script>	